from Base import message, intersect, SS_VALID
from DRG import MDCG_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["42.3301","42.3302","42.3304","42.3306","42.9202","43.4101","43.4102","43.4105","43.4108","44.4301","44.4302","44.4303","45.3001","45.3002","45.3005","45.3006","98.0301","98.0302","42.3300x006","42.3300x007","42.3310","42.8101","42.9200x006","42.9200x008","42.9900x001","42.9901","43.1100x001","43.4100x011","43.4100x013","43.4100x014","43.4100x015","43.4100x016","43.4100x026","43.4103","43.4104","44.1100x002","44.2200x001","44.2200x003","44.2201","44.2202","44.3200x001","44.4300x001","44.4300x002","44.4300x003","44.4300x004","44.4300x005","44.9300","44.9400","44.9800x003","44.9800x004","97.5101","97.5902","97.5903"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss:
    message('符合GK2入组条件，匹配规则：主手术匹配')

    if MDCG_DRG.GK23_group(record):
      return 'GK23'

    if MDCG_DRG.GK25_group(record):
      return 'GK25'
        
    return 'GK2'
  else:
    return ''
    
